package eu.jpereira.trainings.designpatterns.creational.abstractfactory;


public class FactoryReport implements FactoryReportIn{

	@Override
	public Report getReport(String type){
		Report report = new Report();
		if(type.equals("JSON")){
			FactoryJSONReport factory = new FactoryJSONReport();
			report.setBody(factory.getBody());
			report.setFooter(factory.getFooter());
			report.setHeader(factory.getHeader());
		} else if(type.equals("XML")) {
			FactoryXMLReport factory = new FactoryXMLReport();
			report.setFooter(factory.getFooter());
			report.setHeader(factory.getHeader());
			report.setBody(factory.getBody());
		}
		
		return report;
	}

}
